from flask import Flask,render_template
app = Flask(__name__)

@app.route('/',methods=['get'])
def index():
    # flask如何给jinja2模版传递数据
    # 1.基本数据传递
    # return render_template("index.html"
    #                        ,title='   Home    ',
    #                        condition=False,another_condition=False,
    #                        sequence=["a","b","c"])

    # 2.使用字典打包传递
    data={
        "title":"Home",
        "condition" : False,
        "another_condition" : False,
        "sequence" : ["a", "b", "c"]
    }

    return render_template("index.html",**data)

if __name__ == '__main__':
    app.run(debug=True,host='0.0.0.0')

